# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-jaraco.functools
pkgver=4.0.1
pkgrel=0
pkgdesc="Functools like those found in stdlib"
url="https://github.com/jaraco/jaraco.functools"
arch="noarch"
license="MIT"
# py3-setuptools_scm is required to set version of python module
depends="
	py3-jaraco.classes
	py3-more-itertools
	python3
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-setuptools_scm
	py3-wheel
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/j/jaraco_functools/jaraco_functools-$pkgver.tar.gz"
builddir="$srcdir/jaraco_functools-$pkgver"

# backwards compatibility for old name
replaces="py3-jaraco-functools"
provides="py3-jaraco-functools=$pkgver-r$pkgrel"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
04e0ea4719ec8c4439e5a1dd3c3ba0241b21b54b06d53ecc44263046e994aa736b9d196490edd3fd9d7ea997c23c177b30db506b2088bd9de62c637856101982  jaraco_functools-4.0.1.tar.gz
"
